package com.lzy.concertticket.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName tb_seat
 */
@TableName(value ="tb_seat")
@Data
public class SeatEntity extends BaseEntity implements Serializable {
    /**
     * 座位ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 座位名称
     */
    private String seatName;

    /**
     * 演唱会ID
     */
    private Long concertId;

    /**
     * 区域ID
     */
    private Long zoneId;

    /**
     * 座位状态(1:正常 2:锁定 3:售出)
     */
    private Integer status;

    /**
     * 座位价格
     */
    private BigDecimal price;

    /**
     * 购买人
     */
    private Date purchaserId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SeatEntity other = (SeatEntity) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getSeatName() == null ? other.getSeatName() == null : this.getSeatName().equals(other.getSeatName()))
            && (this.getConcertId() == null ? other.getConcertId() == null : this.getConcertId().equals(other.getConcertId()))
            && (this.getZoneId() == null ? other.getZoneId() == null : this.getZoneId().equals(other.getZoneId()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getPurchaserId() == null ? other.getPurchaserId() == null : this.getPurchaserId().equals(other.getPurchaserId()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getSeatName() == null) ? 0 : getSeatName().hashCode());
        result = prime * result + ((getConcertId() == null) ? 0 : getConcertId().hashCode());
        result = prime * result + ((getZoneId() == null) ? 0 : getZoneId().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getPurchaserId() == null) ? 0 : getPurchaserId().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", seatName=").append(seatName);
        sb.append(", concertId=").append(concertId);
        sb.append(", zoneId=").append(zoneId);
        sb.append(", status=").append(status);
        sb.append(", price=").append(price);
        sb.append(", purchaserId=").append(purchaserId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}